home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr15 / ixe130.zip / IXE.DOC < prev    next >
Text File  |  1993-05-08  |  7KB  |  133 lines

  1. /*
  2.     Filename    :   ixe.doc
  3.     Author      :   Ray E. Bornert II
  4.     Date        :   1993-MAY-06
  5.  
  6.     Copyright (C) 1993 HixoxiH Software.  All rights reserved.
  7. */
  8.  
  9. IXE supported video modes
  10.  
  11. IXE will precompile icons for video modes where one byte of data represents
  12. one pixel on the screen.  We call these the 256 color modes. The most common
  13. of these modes is 320x200. The BIOS hex number for this mode is 13h.
  14. Mode 13h has many derivatives.  Most of these derivatives use multiple planes
  15. where 1 byte in A0000-AFFFF system ram (SRAM) address space touches 4 bytes
  16. (4 different planes) in the video ram (VRAM) address space. These are
  17. generally referred to as the planar modes. IXE precompiles for either flat
  18. non-planar modes like standard vga mode 13h or non-flat planar modes like
  19. modeX 320x240.  IXE's can in theory be used for blitting directly to the
  20. video card for SVGA modes like 1024x768 as long as a (VRAM) bank boundary
  21. is not crossed.  The IXE compiler currently makes no provision for bank
  22. switching or clipping of any kind.  If you attempted to blit an .IXE near
  23. the edge of a bank boundary you would see a split image on the screen of some
  24. kind.  You will not hurt anything, it just won't look correct.
  25.  
  26. IXE provides for the generation of 8,16 or 32 (default) bit machine code.
  27.  
  28. Using the IXE compiler:
  29.  
  30. 1. The IXE compiler accepts as input, flat bitmap data with no header or
  31.    trailer.  For lack of a better extension we will refer to these files
  32.    as .PAN files, meaning a panel of artwork of some kind.  The data in a
  33.    .PAN file is an ordered array of bytes.  The data is ordered left to
  34.    right top to bottom. Each byte represents one color VGA palette index
  35.    for 256 color VGA modes where one byte equals one pixel.
  36.    The byte values in a 4x4 icon
  37.  
  38.    FF 23 8B 9C
  39.    22 64 64 93
  40.    10 01 95 82
  41.    33 69 37 02
  42.  
  43.    would appear in a .PAN file in the following order:
  44.    FF 23 8B 9C 22 64 64 93 10 01 95 82 33 69 37 02
  45.    That is contiguous order left to right top to bottom.
  46.  
  47. 2. The IXE compiler produces as output, a file with an .IXE extension meaning
  48.    Icon Executable. An .IXE contains straight binary machine code for the
  49.    specific blitting of the compiled icon.  The palette indexes for the icon
  50.    are combined inside the actual instructions as immediate data values.
  51.    The resulting code is the absolute FASTEST possible way to blit that icon.
  52.    IXE's are very fast.  Performance varies depending on the data and how it
  53.    was compiled but at the very worst they are more than TWICE as fast as the
  54.    fastest traditional blitting routines.  In very typical cases they can
  55.    be 300%-400% faster!
  56.  
  57. 3. The IXE compiler generates .IXE files with lengths that are guaranteed
  58.    to be an even multiple of 4.  The last 4 bytes of an .IXE (the trailer)
  59.    contain 2 word values for the width and the height of the compiled icon.
  60.    The width is first and the height is last.  This trailer is useful to
  61.    programs like IXESHOW that present IXE's on the display for viewing.
  62.  
  63. 4. Once an IXE has been compiled it can be read into memory and called.
  64.    For optimization purposes we recommend that IXE's in memory be dword
  65.    aligned (4byte boundary).  The code inside an IXE is optimized to sit
  66.    on word boundaries and since .IXE byte lengths are even multiples of
  67.    4 bytes they can be nicely concatenated together and will all be
  68.    dword aligned if the very first one is dword aligned.  If the IXE's
  69.    are dword aligned they will run slightly faster.
  70.  
  71. 5. An example command line for using IXE to compile the file MY.PAN is:
  72.  
  73.    C:\> ixe my.pan
  74.  
  75.    This will produce a file called MY.IXE that can be loaded into memory
  76.    and invoked with one of the ixeBlit routines defined in IXEBLIT.C.
  77.  
  78. 6. After you compile an .IXE you can verify your result with IXESHOW.
  79.    To verify MY.IXE using IXESHOW you would do the following:
  80.  
  81.    C:\> ixeshow my.ixe
  82.  
  83.    The IXESHOW screen will appear with your icon in the upper left of the
  84.    display.  You can then use the arrow keys to move your icon around.
  85.    Press ESCAPE to exit.  After exiting, IXESHOW will display performance
  86.    results for the .IXE in blits per second (BPS) and pixels per second (PPS)
  87.    If you use your own palette instead of the standard default 256 color
  88.    VGA palette the you will want to include the name of the .PAL file on
  89.    the IXESHOW command line as follows:
  90.  
  91.    C:\> ixeshow my.ixe my.pal
  92.  
  93.    IXESHOW will use your palette instead of the default palette and your
  94.    icon will appear the way it is supposed to.
  95.  
  96. 7. Palettes files (.PAL) are 768 bytes long and contain the 3 byte
  97.    red,green,blue (RGB) definitions for each palette index 0-255.
  98.    There are 256 definitions each 3 bytes long (256*3==768).  The first
  99.    3 byes define the RGB color for palette index 0.  The last 3 bytes
  100.    define the RGB color for palette index 255.  Every definition in between
  101.    is in consecutive ascending order (e.g. 0,1,2,3,4...253,254,255).  The
  102.    3 byte definitions are ordered RGB that is red byte first green byte
  103.    second and blue byte last.  On the VGA only the low order first 6 bits,
  104.    bits 5-0 of each byte are used to define the corresponding intensity for
  105.    the 3 color guns red green and blue.  So the 3 byte color definitions
  106.    should only contain values 0-63.  It is okay to have values greater than
  107.    63 that is to say bits 7-6 turned on but bits 7-6 are ignored and are
  108.    therefore meaningless.
  109.  
  110. Instructions for calling an IXE
  111. Before you can call an IXE you must first setup some registers.
  112. If you are blitting to the video card then you must have previously set
  113. the correct video mode.
  114.  
  115. 1. (e)bx must contain the width in pixels of the destination buffer
  116.    If your video mode is 320x240 and you are blitting directly
  117.    to video memory then (e)bx should be set to 320.  If you are blitting
  118.    to an offscreen buffer 256 bytes wide then (e)bx should be set to 256.
  119.  
  120. 2. ds:(e)di should contain the segment:offset address of the destination
  121.    where the ixe will be blitted to.  If your video mode is 320x240 and
  122.    you are blitting directly to the card and you want the upper left corner
  123.    of your IXE sprite to be at y=12,x=34 then DS should contain A000h and
  124.    (e)di should contain 0F22h (320*12+34==3874==0F22h).  Remember that for
  125.    non-planar modes you can blit to a buffer in conventional ram and then
  126.    copy that buffer to the video card later.
  127.  
  128. 3. You jump to the IXE via the CALL instruction
  129.  
  130. 4. The routines in IXEBLIT.C will show you the way.
  131.    Unless you really need to do something out of the ordinary
  132.    they should do just fine.
  133.